#include "lib.h"
#ifdef  __cplusplus  
extern "C" {  
#endif  
unsigned long pow(unsigned long x, unsigned long y)
{

	unsigned long temp = x;

	if (y == 0)
	{	
		/* code */
		return 1;
	}

	
	for (unsigned long  i = 1; i < y; i++)
	{
		x *= temp;
		
	}
	

	return x;
}


int strlen(char * String)
{
	register int __res;
	__asm__	__volatile__	(	"cld	\n\t"
					"repne	\n\t"
					"scasb	\n\t"
					"notl	%0	\n\t"
					"decl	%0	\n\t"
					:"=c"(__res)
					:"D"(String),"a"(0),"0"(0xffffffff)
					:
				);
	return __res;
}



int strcmp(char* src,char* dst){

	while((*src && *src != '\0'))
	{

		if(*src != *dst)
		{
			return -1;
		}
		src++;
		dst++;

	}

	if(*dst || *dst != '\0')
	{
		return -1;
	}

	return 0;
}



#ifdef  __cplusplus  
}  
#endif  /* end of __cplusplus */  
